Add deterministic E2E settings personas#5813
Conversation
Separate build-time inputs from per-run services so verified artifacts can accelerate local iteration without weakening fresh database or provider boundaries.
Model settings personas as deterministic, serializable resource graphs and provide production-first factories with exact-ID cleanup so impossible or cross-world fixture states fail before browser tests run. Co-authored-by: Cursor <cursoragent@cursor.com>
Provision the validated world through real product boundaries, capture isolated sessions through the login UI, and assert persona contracts plus two-worker cross-world isolation without exposing credentials to Playwright. Co-authored-by: Cursor <cursoragent@cursor.com>
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds deterministic settings personas to the guarded E2E stack. The main changes are:
Confidence Score: 4/5The malformed-canary cleanup path needs a fix before merging.
apps/sim/e2e/scripts/run.ts; apps/sim/e2e/support/build-manifest.ts
|
| Filename | Overview |
|---|---|
| apps/sim/e2e/scripts/run.ts | Adds the guarded orchestration lifecycle, secret handoff, cleanup supervisor, and artifact leak scan; malformed canary state can reduce scan coverage. |
| apps/sim/e2e/support/build-manifest.ts | Adds content-addressed build caching and atomic activation; cache-hit runs leave interrupted temporary artifacts untouched. |
| apps/sim/e2e/support/run-lock.ts | Adds token- and process-identity-based locking, stale-owner recovery, supervisor transfer, and failure retention. |
| apps/sim/e2e/support/deployment-profile.ts | Defines narrow child environments with isolated home directories and separate build and runtime secrets. |
| apps/sim/e2e/fixtures/e2e-world.ts | Defines validated scenario manifests, persona credentials, storage-state paths, and secret-field checks. |
| apps/sim/playwright.config.ts | Adds the serialized navigation, workflow, persona, and two-worker isolation project chain. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Acquire orchestrator lock] --> B[Create isolated database and services]
B --> C[Build or restore verified app]
C --> D[Seed validated persona worlds]
D --> E[Capture auth states through login UI]
E --> F[Run dependent Playwright projects]
F --> G[Stop managed processes]
G --> H[Drop database and remove private state]
H --> I[Scan diagnostics for secret leaks]
I --> J[Release or retain lock]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Acquire orchestrator lock] --> B[Create isolated database and services]
B --> C[Build or restore verified app]
C --> D[Seed validated persona worlds]
D --> E[Capture auth states through login UI]
E --> F[Run dependent Playwright projects]
F --> G[Stop managed processes]
G --> H[Drop database and remove private state]
H --> I[Scan diagnostics for secret leaks]
I --> J[Release or retain lock]
Reviews (1): Last reviewed commit: "Harden E2E persona orchestration and rem..." | Re-trigger Greptile
| try { | ||
| assertNoForbiddenProviderTraffic( | ||
| [app?.logPath, realtime?.logPath].filter((value): value is string => Boolean(value)) | ||
| ) | ||
| leakCanarySecrets = loadSyntheticSecretCanaryForScan(leakCanarySecrets, canarySecretsPath) | ||
| } catch (error) { | ||
| failed = true | ||
| process.exitCode = 1 | ||
| console.error(error) | ||
| } finally { | ||
| rmSync(credentialsPath, { force: true }) | ||
| rmSync(canarySecretsPath, { force: true }) | ||
| } |
There was a problem hiding this comment.
Malformed Canary Weakens Leak Scan
If the seeded canary file is truncated or invalid, loading it throws before persona passwords and invitation tokens are added to leakCanarySecrets, but this finally block deletes the only durable copy. Cleanup can then scan reports and traces with only the initial runtime secrets, allowing a persona secret leak to go undetected.
| if (!existsSync(buildCacheDirectory)) return [] | ||
| const entries = readdirSync(buildCacheDirectory) | ||
| for (const name of entries.filter((entry) => entry.includes('.tmp-'))) { | ||
| rmSync(path.join(buildCacheDirectory, name), { recursive: true, force: true }) | ||
| } |
There was a problem hiding this comment.
Generate runtime secrets per run, fail closed when diagnostics cannot be scanned, and harden cache and process cleanup while removing the unused exact-ID cleanup module until retained-stack support has a real consumer.
afe2dd7 to
b4a0ff2
Compare
Make local-only parser scenarios explicit so the safety suite tests the intended policy instead of inheriting the GitHub runner environment.
PR SummaryMedium Risk Overview The orchestrator now seeds → captures auth → runs tests with a non-secret persona manifest, separate private credentials, per-child least-privilege envs (build sentinels vs runtime), an exclusive run lock, optional local Supporting changes include co-locating Reviewed by Cursor Bugbot for commit 428a54b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 27878e0. Configure here.
Match production organization invitations even when workspace grants are attached, and remove an unused cookie-reset method from the E2E client.
b0b0470
into
e2e/settings-playwright

Summary
Test plan
bun run type-checkbun run check:utilsbunx biome check e2e package.json